//
//  DataManagerViewController.m
//  DataManager
//
//  Created by Michael Hinds on 2/8/09.
//  Copyright University of Arkansas 2009. All rights reserved.
//

#import "DataManagerViewController.h"

@implementation DataManagerViewController
@synthesize txtArea;

//getProfile Test
- (IBAction) updateText:(id) sender {
	
	DataManager *dataManager = [[DataManager alloc] initWithRemoteKey:@"abrade5989lap" AndUserID:10769];
	NSDictionary *profile = [dataManager getProfile];
	
	//Debug
	NSLog(@"Number of first level elements: %d", [profile count]);
	txtArea.text = [txtArea.text stringByAppendingFormat:@"Number of first level elements: %d", [profile count]];
	
	NSArray *keys = [profile allKeys];
	for(NSString *key in keys)
	{
		NSLog(key);
	}
	
	NSInteger availableCash  = (NSInteger)[profile objectForKey:@"availableCash"];
	NSLog(@"%d", availableCash);
	/*  shortCollateral
	 longHoldings
	 totalValue
	 inception
	 availableCash
	 shortHoldings */
}

/*
// Override initWithNibName:bundle: to load the view using a nib file then perform additional customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
	[txtArea release];
    [super dealloc];
}

@end
